package cineplanet.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import javax.sql.DataSource;

import cineplanet.dao.ICompraOnlineDAO;
import cineplanet.excepcion.DAOExcepcion;
import cineplanet.modelo.TabCompraonline;

public class CompraOnlineDAO extends HibernateDaoSupport implements ICompraOnlineDAO {

protected Log log = LogFactory.getLog(getClass());
	
	private DataSource dataSource;

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	
	@SuppressWarnings("unchecked")
	public TabCompraonline insertar(TabCompraonline objTabCompraonline) throws DAOExcepcion 
	{
		try {
			getHibernateTemplate().save(objTabCompraonline);
			getHibernateTemplate().flush();
		} catch (Exception e) {
			log.error(e.getMessage());
			throw new DAOExcepcion(e.getMessage());
		}
		return objTabCompraonline;
	}

}
